<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>VideoFrameTexture - Three.js Docs</title>
	<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<script src="../scripts/highlight.min.js"></script>
	<link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
	<link type="text/css" rel="stylesheet" href="../styles/page.css">
</head>
<body>
		<p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Texture.html">Texture</a> → <a href="VideoTexture.html">VideoTexture</a> → </p>
	<h1 translate="no">VideoFrameTexture</h1>
		<section>
			<header>
				<div class="class-description"><p>This class can be used as an alternative way to define video data. Instead of using
an instance of <code>HTMLVideoElement</code> like with <code>VideoTexture</code>, <code>VideoFrameTexture</code> expects each frame is
defined manually via <a href="VideoFrameTexture.html#setFrame">VideoFrameTexture#setFrame</a>. A typical use case for this module is when
video frames are decoded with the WebCodecs API.</p></div>
				<h2>Code Example</h2>
				<div translate="no"><pre><code class="language-js">const texture = new THREE.VideoFrameTexture();
texture.setFrame( frame );
</code></pre></div>
			</header>
			<article>
				<div class="container-overview">
					<h2>Constructor</h2>
					<h3 class="name name-method" id="VideoFrameTexture" translate="no">new <a href="#VideoFrameTexture">VideoFrameTexture</a><span class="signature">( mapping : <span class="param-type">number</span>, wrapS : <span class="param-type">number</span>, wrapT : <span class="param-type">number</span>, magFilter : <span class="param-type">number</span>, minFilter : <span class="param-type">number</span>, format : <span class="param-type">number</span>, type : <span class="param-type">number</span>, anisotropy : <span class="param-type">number</span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Constructs a new video frame texture.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>mapping</strong>
									</td>
									<td class="description last">
										<p>The texture mapping.</p>
										<p>Default is <code>Texture.DEFAULT_MAPPING</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>wrapS</strong>
									</td>
									<td class="description last">
										<p>The wrapS value.</p>
										<p>Default is <code>ClampToEdgeWrapping</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>wrapT</strong>
									</td>
									<td class="description last">
										<p>The wrapT value.</p>
										<p>Default is <code>ClampToEdgeWrapping</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>magFilter</strong>
									</td>
									<td class="description last">
										<p>The mag filter value.</p>
										<p>Default is <code>LinearFilter</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>minFilter</strong>
									</td>
									<td class="description last">
										<p>The min filter value.</p>
										<p>Default is <code>LinearFilter</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>format</strong>
									</td>
									<td class="description last">
										<p>The texture format.</p>
										<p>Default is <code>RGBAFormat</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>type</strong>
									</td>
									<td class="description last">
										<p>The texture type.</p>
										<p>Default is <code>UnsignedByteType</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>anisotropy</strong>
									</td>
									<td class="description last">
										<p>The anisotropy value.</p>
										<p>Default is <code>Texture.DEFAULT_ANISOTROPY</code>.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<h2 class="subsection-title">Properties</h2>
				<div class="member">
					<h3 class="name" id="isVideoFrameTexture" translate="no">.<a href="#isVideoFrameTexture">isVideoFrameTexture</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
					<div class="description">
						<p>This flag can be used for type testing.</p>
						<p>Default is <code>true</code>.</p>
					</div>
				</div>
				<h2 class="subsection-title">Methods</h2>
					<h3 class="name name-method" id="setFrame" translate="no">.<a href="#setFrame">setFrame</a><span class="signature">( frame : <span class="param-type">VideoFrame</span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Sets the current frame of the video. This will automatically update the texture
so the data can be used for rendering.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>frame</strong>
									</td>
									<td class="description last">
										<p>The video frame.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">()</span> </h3>
					<div class="method">
						<div class="description">
							<p>This method overwritten with an empty implementation since
this type of texture is updated via <code>setFrame()</code>.</p>
						</div>
						<dl class="details">
							<dt class="tag-overrides"><strong>Overrides:</strong> <a href="VideoTexture.html#update">VideoTexture#update</a></dt>
						</dl>
					</div>
				<h2 class="subsection-title">Source</h2>
				<p>
					<a href="https://github.com/mrdoob/three.js/blob/master/src/textures/VideoFrameTexture.js" translate="no" target="_blank" rel="noopener">src/textures/VideoFrameTexture.js</a>
				</p>
			</article>
		</section>
<script src="../scripts/linenumber.js"></script>
<script src="../scripts/page.js"></script>
</body>
</html>